import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
// 导入router
import router from './router'

// 导入elementPlus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 让日期控件为中文
import 'dayjs/locale/zh-cn';
import locale from 'element-plus/es/locale/lang/zh-cn';

const app = createApp(App)
// 全局前置中间件
/**
 * to :即将进入的信息
 * from :即将离开的信息
 */
router.beforeEach(async (to,from,next)=>{
    console.log(to);
    console.log(from);
    next()
})
//使用路由器
app.use(createPinia()).use(router).use(ElementPlus,{locale});

app.mount('#app')
